import axios from 'axios'
import Vue from 'vue'

axios.defaults.baseURL = 'https://autumnfish.cn'

export function getSliderPics(callback) {
  axios.get('/banner?type=2').then(res => {
    // callback(res.data.banners)
    callback({ data: res.data.banners, status: 1 })
    // console.log(res.data.banners)
  })
    .catch(
      err => {
        callback({ data: [], status: 0 })
      }
    )
}
export function getUserSong(callback) {
  axios.get("/personalized/newsong").then(res => {
    callback({ data: res.data, status: 1 })
  })
    .catch(
      err => {
        callback({ data: [], status: 0 })
      }
    )
}
export function geOneSong({ id }) {
  return axios.get(`/song/url?id=${id}`)
}